package com.zll.dms.controller;

import com.zll.dms.model.Role;
import com.zll.dms.pojo.ResultData;
import com.zll.dms.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 角色相关接口
 */
@RestController
@RequestMapping("role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    /**
     * 获取全部角色
     * @return
     */
    @GetMapping("all")
    public ResultData getAllRole() {
        List<Role> allRole = roleService.getAllRole();
        return ResultData.success(allRole);
    }
}
